package com.linkage.educloud.ah.view.fragment.login;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager;
import android.view.View;
import android.widget.TextView;

import com.linkage.educloud.ah.R;
import com.linkage.educloud.ah.view.BasicTitleFragment;
import com.zhouyou.http.EasyHttp;
import com.zhouyou.http.callback.SimpleCallBack;
import com.zhouyou.http.exception.ApiException;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * <desc>
 * Created by The Moss on 2018/8/21.
 */

public class RegisterFragment extends BasicTitleFragment {
    @BindView(R.id.fragment_register_text)
    TextView fragmentRegisterText;

    @Override
    protected int attachLayoutRes() {
        return R.layout.fragment_register;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    }

    @Override
    public boolean onBackPressed() {
        fragmentManager.popBackStack(RegisterFragment.class.getSimpleName(), FragmentManager.POP_BACK_STACK_INCLUSIVE);
        return super.onBackPressed();
    }

    @OnClick(R.id.fragment_register_text)
    public void onClick() {
        EasyHttp.post("")
                .accessToken(true)
                .sign(true)
                .timeStamp(true)
                .params("commandtype", "getRollAds")
                .params("radsType","5")
                .execute(new SimpleCallBack<String>() {
                    @Override
                    public void onError(ApiException e) {

                    }

                    @Override
                    public void onSuccess(String s) {

                    }
                });
    }
}
